package com.zuxia.action;

import java.io.IOException;
import java.util.Map;

import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;

import com.zuxia.iservices.ChangeServicesI;

public class ChangeAction extends BaseAction {
	//个人中心action
	private ChangeServicesI changeServices;
	
	
	
	public ChangeServicesI getChangeServices() {
		return changeServices;
	}
	
	public void setChangeServices(ChangeServicesI changeServices) {
		this.changeServices = changeServices;
	}
	
	private String user;
	private String password;
	private String xpassword;
	private int id;
	
	
	public String getUser() {
		return user;
	}
	
	public void setUser(String user) {
		this.user = user;
	}
	
	public String getPassword() {
		return password;
	}
	
	public void setPassword(String password) {
		this.password = password;
	}
	
	
	public String getXpassword() {
		return xpassword;
	}

	public void setXpassword(String xpassword) {
		this.xpassword = xpassword;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void changePwd(){
		Boolean s=changeServices.userShowPwd(user,password);
			try {
				getResponse().getWriter().println(s);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}	
			
	}
	//修改密码的方法
	public void  updatePwd(){
			Boolean b=changeServices.userUpdatePwd(user, password, xpassword);
			System.err.println(b);
			try {
				getResponse().getWriter().println(b);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}	
		
	}
	//显示个人信息的方法
	public void selectShow(){
		String json =changeServices.userSelect(id);
		try {
			getResponse().getWriter().println(json);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
